package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AccountDetailFallBack;
import cn.cs.fallback.RestShopFallBack;
import cn.cs.pojo.AccountDetail;
import cn.cs.pojo.UserBalance;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = AccountDetailFallBack.class)
public interface AccountDetailClient {


    @RequestMapping(value = "/addAccountDetail", method = RequestMethod.POST)
    public Integer addAccountDetail(@RequestBody AccountDetail accountDetail)throws Exception;

    @RequestMapping(value = "/getAccountDetail", method = RequestMethod.POST)
    public List<AccountDetail> getAccountDetail(@RequestParam("userId") String userId) throws Exception;

    @RequestMapping(value = "/getAccountDetailInvoice", method = RequestMethod.POST)
    public List<AccountDetail> getAccountDetailInvoice(@RequestParam("userId") String userId) throws Exception;

    @RequestMapping(value = "/getAccountDetailById", method = RequestMethod.POST)
    public Map<String, Object> getAccountDetailById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/updateAccountStatus", method = RequestMethod.POST)
    public Integer updateAccountStatus(@RequestParam("id") String id, @RequestParam("newAmonut") Double newAmonut)throws Exception;

    @RequestMapping(value = "/updateAccountDetailByIds", method = RequestMethod.POST)
    public int updateAccountDetailByIds(@RequestBody String[] params)throws Exception;
}

